﻿//********************************************************************************//
//创建日期：<创建日期，2010-08-02>
//创建作者：<王一飞，wangyifei@shanghai3h.com>
//功能说明：YS_QT_QUXIANYSLYQK实体层次
//********************************************************************************//

#region Entity

using System;
using System.Data;
using Entity;
using Oracle.DataAccess.Client;
using Platform.Configuration;
using Platform.Data;

namespace Entity
{
    [Serializable]
    public class YS_QT_QUXIANYSLYQK
    {
        private double? m_db_n_chengshicfl;

        private double? m_db_n_gongyecfl;

        private double? m_db_n_gongyihyl;

        private double? m_db_n_guoluhyl;

        private double? m_db_n_jianjiexhl;

        private double? m_db_n_lengquexhl;

        private double? m_db_n_wanyuanxsl;

        private decimal? m_dec_i_chengshicfl;

        private decimal? m_dec_i_chengshixsl;

        private decimal? m_dec_i_feichanggsl;

        private decimal? m_dec_i_gongyecfl;

        private decimal? m_dec_i_gongyexsl;

        private decimal? m_dec_i_gongyezcz;

        private decimal? m_dec_i_gongyihyl;

        private decimal? m_dec_i_gongyixsl;

        private decimal? m_dec_i_guolucql;

        private decimal? m_dec_i_guoluhyl;

        private decimal? m_dec_i_haishuilyl;

        private decimal? m_dec_i_jianjiexhl;

        private decimal? m_dec_i_jianjiexsl;

        private decimal? m_dec_i_jlzt;

        private decimal? m_dec_i_lengquexhl;

        private decimal? m_dec_i_lengquexsl;

        private decimal? m_dec_i_ym;

        private decimal? m_dec_i_yushuilyl;

        private decimal m_dec_id;

        private DateTime? m_DT_d_caozuosj;

        private string m_str_s_beiyong1;

        private string m_str_s_beiyong2;

        private string m_str_s_caozuor;

        private string m_str_s_quxian;

        /// <summary>
        ///     主键
        /// </summary>
        public decimal ID
        {
            get { return m_dec_id; }
            set { m_dec_id = value; }
        }

        /// <summary>
        ///     年月
        /// </summary>
        public decimal? I_YM
        {
            get { return m_dec_i_ym; }
            set { m_dec_i_ym = value; }
        }

        /// <summary>
        ///     区县
        /// </summary>
        public string S_QUXIAN
        {
            get { return m_str_s_quxian; }
            set { m_str_s_quxian = value; }
        }

        /// <summary>
        ///     工业新水量
        /// </summary>
        public decimal? I_GONGYEXSL
        {
            get { return m_dec_i_gongyexsl; }
            set { m_dec_i_gongyexsl = value; }
        }

        /// <summary>
        ///     工业重复量
        /// </summary>
        public decimal? I_GONGYECFL
        {
            get { return m_dec_i_gongyecfl; }
            set { m_dec_i_gongyecfl = value; }
        }

        /// <summary>
        ///     工业重复率
        /// </summary>
        public double? N_GONGYECFL
        {
            get { return m_db_n_gongyecfl; }
            set { m_db_n_gongyecfl = value; }
        }

        /// <summary>
        ///     冷却新水量
        /// </summary>
        public decimal? I_LENGQUEXSL
        {
            get { return m_dec_i_lengquexsl; }
            set { m_dec_i_lengquexsl = value; }
        }

        /// <summary>
        ///     冷却循环量
        /// </summary>
        public decimal? I_LENGQUEXHL
        {
            get { return m_dec_i_lengquexhl; }
            set { m_dec_i_lengquexhl = value; }
        }

        /// <summary>
        ///     冷却循环率
        /// </summary>
        public double? N_LENGQUEXHL
        {
            get { return m_db_n_lengquexhl; }
            set { m_db_n_lengquexhl = value; }
        }

        /// <summary>
        ///     工艺新水量
        /// </summary>
        public decimal? I_GONGYIXSL
        {
            get { return m_dec_i_gongyixsl; }
            set { m_dec_i_gongyixsl = value; }
        }

        /// <summary>
        ///     工艺回用量
        /// </summary>
        public decimal? I_GONGYIHYL
        {
            get { return m_dec_i_gongyihyl; }
            set { m_dec_i_gongyihyl = value; }
        }

        /// <summary>
        ///     工艺回用率
        /// </summary>
        public double? N_GONGYIHYL
        {
            get { return m_db_n_gongyihyl; }
            set { m_db_n_gongyihyl = value; }
        }

        /// <summary>
        ///     锅炉产汽量
        /// </summary>
        public decimal? I_GUOLUCQL
        {
            get { return m_dec_i_guolucql; }
            set { m_dec_i_guolucql = value; }
        }

        /// <summary>
        ///     锅炉回用量
        /// </summary>
        public decimal? I_GUOLUHYL
        {
            get { return m_dec_i_guoluhyl; }
            set { m_dec_i_guoluhyl = value; }
        }

        /// <summary>
        ///     锅炉回用率
        /// </summary>
        public double? N_GUOLUHYL
        {
            get { return m_db_n_guoluhyl; }
            set { m_db_n_guoluhyl = value; }
        }

        /// <summary>
        ///     工业总产值
        /// </summary>
        public decimal? I_GONGYEZCZ
        {
            get { return m_dec_i_gongyezcz; }
            set { m_dec_i_gongyezcz = value; }
        }

        /// <summary>
        ///     万元新水量
        /// </summary>
        public double? N_WANYUANXSL
        {
            get { return m_db_n_wanyuanxsl; }
            set { m_db_n_wanyuanxsl = value; }
        }

        /// <summary>
        ///     城市新水量
        /// </summary>
        public decimal? I_CHENGSHIXSL
        {
            get { return m_dec_i_chengshixsl; }
            set { m_dec_i_chengshixsl = value; }
        }

        /// <summary>
        ///     城市重复量
        /// </summary>
        public decimal? I_CHENGSHICFL
        {
            get { return m_dec_i_chengshicfl; }
            set { m_dec_i_chengshicfl = value; }
        }

        /// <summary>
        ///     城市重复率
        /// </summary>
        public double? N_CHENGSHICFL
        {
            get { return m_db_n_chengshicfl; }
            set { m_db_n_chengshicfl = value; }
        }

        /// <summary>
        ///     间接新水量
        /// </summary>
        public decimal? I_JIANJIEXSL
        {
            get { return m_dec_i_jianjiexsl; }
            set { m_dec_i_jianjiexsl = value; }
        }

        /// <summary>
        ///     间接循环量
        /// </summary>
        public decimal? I_JIANJIEXHL
        {
            get { return m_dec_i_jianjiexhl; }
            set { m_dec_i_jianjiexhl = value; }
        }

        /// <summary>
        ///     间接循环率
        /// </summary>
        public double? N_JIANJIEXHL
        {
            get { return m_db_n_jianjiexhl; }
            set { m_db_n_jianjiexhl = value; }
        }

        /// <summary>
        ///     非常规水量
        /// </summary>
        public decimal? I_FEICHANGGSL
        {
            get { return m_dec_i_feichanggsl; }
            set { m_dec_i_feichanggsl = value; }
        }

        /// <summary>
        ///     海水利用量
        /// </summary>
        public decimal? I_HAISHUILYL
        {
            get { return m_dec_i_haishuilyl; }
            set { m_dec_i_haishuilyl = value; }
        }

        /// <summary>
        ///     雨水利用量
        /// </summary>
        public decimal? I_YUSHUILYL
        {
            get { return m_dec_i_yushuilyl; }
            set { m_dec_i_yushuilyl = value; }
        }

        /// <summary>
        ///     是否逻辑删除
        /// </summary>
        public decimal? I_JLZT
        {
            get { return m_dec_i_jlzt; }
            set { m_dec_i_jlzt = value; }
        }

        /// <summary>
        ///     备用1
        /// </summary>
        public string S_BEIYONG1
        {
            get { return m_str_s_beiyong1; }
            set { m_str_s_beiyong1 = value; }
        }

        /// <summary>
        ///     备用2
        /// </summary>
        public string S_BEIYONG2
        {
            get { return m_str_s_beiyong2; }
            set { m_str_s_beiyong2 = value; }
        }

        /// <summary>
        ///     操作时间
        /// </summary>
        public DateTime? D_CAOZUOSJ
        {
            get { return m_DT_d_caozuosj; }
            set { m_DT_d_caozuosj = value; }
        }

        /// <summary>
        ///     操作人
        /// </summary>
        public string S_CAOZUOR
        {
            get { return m_str_s_caozuor; }
            set { m_str_s_caozuor = value; }
        }
    }
}

#endregion

#region EntityProcess

namespace BLL.Access
{
    //using System.Data.OracleClient;

    public class YS_QT_QUXIANYSLYQKProcess
    {
        #region Field

        protected string conn;

        #endregion

        #region Construction

        public YS_QT_QUXIANYSLYQKProcess()
        {
            conn = ConfigHelper.PlatformConnString;
        }

        #endregion

        #region public

        /// <summary>
        ///     根据YS_QT_QUXIANYSLYQK实体添加或者修改YS_QT_QUXIANYSLYQK信息
        /// </summary>
        public bool InsertOrUpdate(YS_QT_QUXIANYSLYQK YS_QT_QUXIANYSLYQK, OracleTransaction Transaction)
        {
            if (YS_QT_QUXIANYSLYQK.ID == 0)
                InsertYS_QT_QUXIANYSLYQK(YS_QT_QUXIANYSLYQK, Transaction);
            else
                UpdateYS_QT_QUXIANYSLYQK(YS_QT_QUXIANYSLYQK, Transaction);
            return YS_QT_QUXIANYSLYQK.ID == 0 ? false : true;
        }

        /// <summary>
        ///     根据YS_QT_QUXIANYSLYQK实体添加或修改YS_QT_QUXIANYSLYQK信息
        /// </summary>
        public bool InsertOrUpdate(YS_QT_QUXIANYSLYQK YS_QT_QUXIANYSLYQK)
        {
            return InsertOrUpdate(YS_QT_QUXIANYSLYQK, null);
        }


        /// <summary>
        ///     根据YS_QT_QUXIANYSLYQK主键删除YS_QT_QUXIANYSLYQK信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteYS_QT_QUXIANYSLYQK(decimal ID, OracleTransaction Transaction)
        {
            var spName = "CS_DelYS_QT_QUXIANYSLYQK";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        ///     根据YS_QT_QUXIANYSLYQK主键删除YS_QT_QUXIANYSLYQK信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteYS_QT_QUXIANYSLYQK(decimal ID)
        {
            return DeleteYS_QT_QUXIANYSLYQK(ID, null);
        }

        /// <summary>
        ///     根据条件删除YS_QT_QUXIANYSLYQK信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteYS_QT_QUXIANYSLYQKsDynamic(string WhereClause, OracleTransaction Transaction)
        {
            var spName = "CS_DelYS_QT_QUXIANYSLYQKsDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = WhereClause;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        ///     根据条件删除YS_QT_QUXIANYSLYQK信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteYS_QT_QUXIANYSLYQKsDynamic(string WhereClause)
        {
            return DeleteYS_QT_QUXIANYSLYQKsDynamic(WhereClause, null);
        }

        /// <summary>
        ///     根据YS_QT_QUXIANYSLYQK主键选择YS_QT_QUXIANYSLYQK信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_QT_QUXIANYSLYQK信息</returns>
        public YS_QT_QUXIANYSLYQK SelectYS_QT_QUXIANYSLYQK(decimal ID, OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_QT_QUXIANYSLYQK";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            OracleDataReader rd;
            if (Transaction == null)
                rd = OracleHelper.ExecuteReader(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                rd = OracleHelper.ExecuteReader(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (rd.Read())
            {
                var YS_QT_QUXIANYSLYQK = PopulateYS_QT_QUXIANYSLYQK(rd);
                rd.Close();
                return YS_QT_QUXIANYSLYQK;
            }
            return null;
        }

        /// <summary>
        ///     根据YS_QT_QUXIANYSLYQK主键选择YS_QT_QUXIANYSLYQK信息
        /// </summary>
        /// <returns>YS_QT_QUXIANYSLYQK信息</returns>
        public YS_QT_QUXIANYSLYQK SelectYS_QT_QUXIANYSLYQK(decimal ID)
        {
            return SelectYS_QT_QUXIANYSLYQK(ID, null);
        }

        /// <summary>
        ///     选择所有YS_QT_QUXIANYSLYQK信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>所有YS_QT_QUXIANYSLYQK信息</returns>
        public DataTable SelectYS_QT_QUXIANYSLYQKsAll(OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_QT_QUXIANYSLYQKsAll";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }

        /// <summary>
        ///     选择所有YS_QT_QUXIANYSLYQK信息
        /// </summary>
        /// <returns>所有YS_QT_QUXIANYSLYQK信息</returns>
        public DataTable SelectYS_QT_QUXIANYSLYQKsAll()
        {
            return SelectYS_QT_QUXIANYSLYQKsAll(null);
        }

        /// <summary>
        ///     根据条件选择YS_QT_QUXIANYSLYQK信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_QT_QUXIANYSLYQK信息</returns>
        public DataTable SelectYS_QT_QUXIANYSLYQKsDynamic(string WhereClause, string OrderByExpression,
            OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_QT_QUXIANYSLYQKsDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }


        /// <summary>
        ///     根据条件选择YS_QT_QUXIANYSLYQK信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <returns>YS_QT_QUXIANYSLYQK信息</returns>
        public DataTable SelectYS_QT_QUXIANYSLYQKsDynamic(string WhereClause, string OrderByExpression)
        {
            return SelectYS_QT_QUXIANYSLYQKsDynamic(WhereClause, OrderByExpression, null);
        }


        /// <summary>
        ///     根据条件选择YS_QT_QUXIANYSLYQK信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_QT_QUXIANYSLYQK信息</returns>
        public DataTable SelectYS_QT_QUXIANYSLYQKsDynamic(string WhereClause, string OrderByExpression, int PageIndex,
            int PageSize, OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_QT_QUXIANYSLYQKsDynPaged";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            storedParams[2].Value = PageIndex;
            storedParams[3].Value = PageSize;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }


        /// <summary>
        ///     根据条件选择YS_QT_QUXIANYSLYQK信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <returns>YS_QT_QUXIANYSLYQK信息</returns>
        public DataTable SelectYS_QT_QUXIANYSLYQKsDynamic(string WhereClause, string OrderByExpression, int PageIndex,
            int PageSize)
        {
            return SelectYS_QT_QUXIANYSLYQKsDynamic(WhereClause, OrderByExpression, PageIndex, PageSize, null);
        }

        /// <summary>
        ///     根据条件更新YS_QT_QUXIANYSLYQK字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateYS_QT_QUXIANYSLYQKsDynamic(string UpdateValue, string WhereClause,
            OracleTransaction Transaction)
        {
            var result = 0;
            if (UpdateValue == "" || WhereClause == "")
                return 0;
            var spName = "CS_UpdYS_QT_QUXIANYSLYQKDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            storedParams[0].Value = UpdateValue;
            storedParams[1].Value = WhereClause;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            result = Convert.ToInt32(storedParams[2].Value);
            return result;
        }

        /// <summary>
        ///     根据条件更新YS_QT_QUXIANYSLYQK字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateYS_QT_QUXIANYSLYQKsDynamic(string UpdateValue, string WhereClause)
        {
            return UpdateYS_QT_QUXIANYSLYQKsDynamic(UpdateValue, WhereClause, null);
        }

        #endregion

        #region Private

        private int InsertYS_QT_QUXIANYSLYQK(YS_QT_QUXIANYSLYQK YS_QT_QUXIANYSLYQK, OracleTransaction Transaction)
        {
            var spName = "CS_InsYS_QT_QUXIANYSLYQK";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = YS_QT_QUXIANYSLYQK.I_YM;
            storedParams[1].Value = YS_QT_QUXIANYSLYQK.S_QUXIAN;
            storedParams[2].Value = YS_QT_QUXIANYSLYQK.I_GONGYEXSL;
            storedParams[3].Value = YS_QT_QUXIANYSLYQK.I_GONGYECFL;
            storedParams[4].Value = YS_QT_QUXIANYSLYQK.N_GONGYECFL;
            storedParams[5].Value = YS_QT_QUXIANYSLYQK.I_LENGQUEXSL;
            storedParams[6].Value = YS_QT_QUXIANYSLYQK.I_LENGQUEXHL;
            storedParams[7].Value = YS_QT_QUXIANYSLYQK.N_LENGQUEXHL;
            storedParams[8].Value = YS_QT_QUXIANYSLYQK.I_GONGYIXSL;
            storedParams[9].Value = YS_QT_QUXIANYSLYQK.I_GONGYIHYL;
            storedParams[10].Value = YS_QT_QUXIANYSLYQK.N_GONGYIHYL;
            storedParams[11].Value = YS_QT_QUXIANYSLYQK.I_GUOLUCQL;
            storedParams[12].Value = YS_QT_QUXIANYSLYQK.I_GUOLUHYL;
            storedParams[13].Value = YS_QT_QUXIANYSLYQK.N_GUOLUHYL;
            storedParams[14].Value = YS_QT_QUXIANYSLYQK.I_GONGYEZCZ;
            storedParams[15].Value = YS_QT_QUXIANYSLYQK.N_WANYUANXSL;
            storedParams[16].Value = YS_QT_QUXIANYSLYQK.I_CHENGSHIXSL;
            storedParams[17].Value = YS_QT_QUXIANYSLYQK.I_CHENGSHICFL;
            storedParams[18].Value = YS_QT_QUXIANYSLYQK.N_CHENGSHICFL;
            storedParams[19].Value = YS_QT_QUXIANYSLYQK.I_JIANJIEXSL;
            storedParams[20].Value = YS_QT_QUXIANYSLYQK.I_JIANJIEXHL;
            storedParams[21].Value = YS_QT_QUXIANYSLYQK.N_JIANJIEXHL;
            storedParams[22].Value = YS_QT_QUXIANYSLYQK.I_FEICHANGGSL;
            storedParams[23].Value = YS_QT_QUXIANYSLYQK.I_HAISHUILYL;
            storedParams[24].Value = YS_QT_QUXIANYSLYQK.I_YUSHUILYL;
            storedParams[25].Value = YS_QT_QUXIANYSLYQK.I_JLZT;
            storedParams[26].Value = YS_QT_QUXIANYSLYQK.S_BEIYONG1;
            storedParams[27].Value = YS_QT_QUXIANYSLYQK.S_BEIYONG2;
            storedParams[28].Value = YS_QT_QUXIANYSLYQK.D_CAOZUOSJ;
            storedParams[29].Value = YS_QT_QUXIANYSLYQK.S_CAOZUOR;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            YS_QT_QUXIANYSLYQK.ID = Convert.ToInt32(storedParams[30].Value);
            return result;
        }

        private bool UpdateYS_QT_QUXIANYSLYQK(YS_QT_QUXIANYSLYQK YS_QT_QUXIANYSLYQK, OracleTransaction Transaction)
        {
            var spName = "CS_UpdYS_QT_QUXIANYSLYQK";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = YS_QT_QUXIANYSLYQK.I_YM;
            storedParams[1].Value = YS_QT_QUXIANYSLYQK.S_QUXIAN;
            storedParams[2].Value = YS_QT_QUXIANYSLYQK.I_GONGYEXSL;
            storedParams[3].Value = YS_QT_QUXIANYSLYQK.I_GONGYECFL;
            storedParams[4].Value = YS_QT_QUXIANYSLYQK.N_GONGYECFL;
            storedParams[5].Value = YS_QT_QUXIANYSLYQK.I_LENGQUEXSL;
            storedParams[6].Value = YS_QT_QUXIANYSLYQK.I_LENGQUEXHL;
            storedParams[7].Value = YS_QT_QUXIANYSLYQK.N_LENGQUEXHL;
            storedParams[8].Value = YS_QT_QUXIANYSLYQK.I_GONGYIXSL;
            storedParams[9].Value = YS_QT_QUXIANYSLYQK.I_GONGYIHYL;
            storedParams[10].Value = YS_QT_QUXIANYSLYQK.N_GONGYIHYL;
            storedParams[11].Value = YS_QT_QUXIANYSLYQK.I_GUOLUCQL;
            storedParams[12].Value = YS_QT_QUXIANYSLYQK.I_GUOLUHYL;
            storedParams[13].Value = YS_QT_QUXIANYSLYQK.N_GUOLUHYL;
            storedParams[14].Value = YS_QT_QUXIANYSLYQK.I_GONGYEZCZ;
            storedParams[15].Value = YS_QT_QUXIANYSLYQK.N_WANYUANXSL;
            storedParams[16].Value = YS_QT_QUXIANYSLYQK.I_CHENGSHIXSL;
            storedParams[17].Value = YS_QT_QUXIANYSLYQK.I_CHENGSHICFL;
            storedParams[18].Value = YS_QT_QUXIANYSLYQK.N_CHENGSHICFL;
            storedParams[19].Value = YS_QT_QUXIANYSLYQK.I_JIANJIEXSL;
            storedParams[20].Value = YS_QT_QUXIANYSLYQK.I_JIANJIEXHL;
            storedParams[21].Value = YS_QT_QUXIANYSLYQK.N_JIANJIEXHL;
            storedParams[22].Value = YS_QT_QUXIANYSLYQK.I_FEICHANGGSL;
            storedParams[23].Value = YS_QT_QUXIANYSLYQK.I_HAISHUILYL;
            storedParams[24].Value = YS_QT_QUXIANYSLYQK.I_YUSHUILYL;
            storedParams[25].Value = YS_QT_QUXIANYSLYQK.I_JLZT;
            storedParams[26].Value = YS_QT_QUXIANYSLYQK.S_BEIYONG1;
            storedParams[27].Value = YS_QT_QUXIANYSLYQK.S_BEIYONG2;
            storedParams[28].Value = YS_QT_QUXIANYSLYQK.D_CAOZUOSJ;
            storedParams[29].Value = YS_QT_QUXIANYSLYQK.S_CAOZUOR;
            storedParams[30].Value = YS_QT_QUXIANYSLYQK.ID;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }


        private YS_QT_QUXIANYSLYQK PopulateYS_QT_QUXIANYSLYQK(IDataReader dr)
        {
            var YS_QT_QUXIANYSLYQK = new YS_QT_QUXIANYSLYQK();
            YS_QT_QUXIANYSLYQK.ID = dr["ID"] == DBNull.Value ? 0 : (decimal) dr["ID"];
            YS_QT_QUXIANYSLYQK.I_YM = dr["I_YM"] == DBNull.Value ? null : (decimal?) dr["I_YM"];
            YS_QT_QUXIANYSLYQK.S_QUXIAN = dr["S_QUXIAN"] == DBNull.Value ? null : (string) dr["S_QUXIAN"];
            YS_QT_QUXIANYSLYQK.I_GONGYEXSL = dr["I_GONGYEXSL"] == DBNull.Value ? null : (decimal?) dr["I_GONGYEXSL"];
            YS_QT_QUXIANYSLYQK.I_GONGYECFL = dr["I_GONGYECFL"] == DBNull.Value ? null : (decimal?) dr["I_GONGYECFL"];
            YS_QT_QUXIANYSLYQK.N_GONGYECFL = dr["N_GONGYECFL"] == DBNull.Value ? null : (double?) dr["N_GONGYECFL"];
            YS_QT_QUXIANYSLYQK.I_LENGQUEXSL = dr["I_LENGQUEXSL"] == DBNull.Value ? null : (decimal?) dr["I_LENGQUEXSL"];
            YS_QT_QUXIANYSLYQK.I_LENGQUEXHL = dr["I_LENGQUEXHL"] == DBNull.Value ? null : (decimal?) dr["I_LENGQUEXHL"];
            YS_QT_QUXIANYSLYQK.N_LENGQUEXHL = dr["N_LENGQUEXHL"] == DBNull.Value ? null : (double?) dr["N_LENGQUEXHL"];
            YS_QT_QUXIANYSLYQK.I_GONGYIXSL = dr["I_GONGYIXSL"] == DBNull.Value ? null : (decimal?) dr["I_GONGYIXSL"];
            YS_QT_QUXIANYSLYQK.I_GONGYIHYL = dr["I_GONGYIHYL"] == DBNull.Value ? null : (decimal?) dr["I_GONGYIHYL"];
            YS_QT_QUXIANYSLYQK.N_GONGYIHYL = dr["N_GONGYIHYL"] == DBNull.Value ? null : (double?) dr["N_GONGYIHYL"];
            YS_QT_QUXIANYSLYQK.I_GUOLUCQL = dr["I_GUOLUCQL"] == DBNull.Value ? null : (decimal?) dr["I_GUOLUCQL"];
            YS_QT_QUXIANYSLYQK.I_GUOLUHYL = dr["I_GUOLUHYL"] == DBNull.Value ? null : (decimal?) dr["I_GUOLUHYL"];
            YS_QT_QUXIANYSLYQK.N_GUOLUHYL = dr["N_GUOLUHYL"] == DBNull.Value ? null : (double?) dr["N_GUOLUHYL"];
            YS_QT_QUXIANYSLYQK.I_GONGYEZCZ = dr["I_GONGYEZCZ"] == DBNull.Value ? null : (decimal?) dr["I_GONGYEZCZ"];
            YS_QT_QUXIANYSLYQK.N_WANYUANXSL = dr["N_WANYUANXSL"] == DBNull.Value ? null : (double?) dr["N_WANYUANXSL"];
            YS_QT_QUXIANYSLYQK.I_CHENGSHIXSL =
                dr["I_CHENGSHIXSL"] == DBNull.Value ? null : (decimal?) dr["I_CHENGSHIXSL"];
            YS_QT_QUXIANYSLYQK.I_CHENGSHICFL =
                dr["I_CHENGSHICFL"] == DBNull.Value ? null : (decimal?) dr["I_CHENGSHICFL"];
            YS_QT_QUXIANYSLYQK.N_CHENGSHICFL =
                dr["N_CHENGSHICFL"] == DBNull.Value ? null : (double?) dr["N_CHENGSHICFL"];
            YS_QT_QUXIANYSLYQK.I_JIANJIEXSL = dr["I_JIANJIEXSL"] == DBNull.Value ? null : (decimal?) dr["I_JIANJIEXSL"];
            YS_QT_QUXIANYSLYQK.I_JIANJIEXHL = dr["I_JIANJIEXHL"] == DBNull.Value ? null : (decimal?) dr["I_JIANJIEXHL"];
            YS_QT_QUXIANYSLYQK.N_JIANJIEXHL = dr["N_JIANJIEXHL"] == DBNull.Value ? null : (double?) dr["N_JIANJIEXHL"];
            YS_QT_QUXIANYSLYQK.I_FEICHANGGSL =
                dr["I_FEICHANGGSL"] == DBNull.Value ? null : (decimal?) dr["I_FEICHANGGSL"];
            YS_QT_QUXIANYSLYQK.I_HAISHUILYL = dr["I_HAISHUILYL"] == DBNull.Value ? null : (decimal?) dr["I_HAISHUILYL"];
            YS_QT_QUXIANYSLYQK.I_YUSHUILYL = dr["I_YUSHUILYL"] == DBNull.Value ? null : (decimal?) dr["I_YUSHUILYL"];
            YS_QT_QUXIANYSLYQK.I_JLZT = dr["I_JLZT"] == DBNull.Value ? null : (decimal?) dr["I_JLZT"];
            YS_QT_QUXIANYSLYQK.S_BEIYONG1 = dr["S_BEIYONG1"] == DBNull.Value ? null : (string) dr["S_BEIYONG1"];
            YS_QT_QUXIANYSLYQK.S_BEIYONG2 = dr["S_BEIYONG2"] == DBNull.Value ? null : (string) dr["S_BEIYONG2"];
            YS_QT_QUXIANYSLYQK.D_CAOZUOSJ = dr["D_CAOZUOSJ"] == DBNull.Value ? null : (DateTime?) dr["D_CAOZUOSJ"];
            YS_QT_QUXIANYSLYQK.S_CAOZUOR = dr["S_CAOZUOR"] == DBNull.Value ? null : (string) dr["S_CAOZUOR"];
            return YS_QT_QUXIANYSLYQK;
        }


        private void AddRowNumber(DataTable dt)
        {
            dt.Columns.Add(new DataColumn("RowNumber", typeof(int)));
            for (var i = 0; i < dt.Rows.Count; i++)
                dt.Rows[i][dt.Columns.Count - 1] = i + 1;
        }

        #endregion
    }
}

#endregion